<span id="load" url="<?=image_url('load.gif');?>"></span>

<?=$system_message;?>
<div class="panel">
	<div class="row">
		<div class="large-3 columns">
		<?if(isset($section_desc)):?>
			<?if($section_desc):?>
				<?$sec = ($section_desc);?>
				<span style="font-weight:bold;font-size:16px;">Section Name:&nbsp;&nbsp;<?=$sec->section_name;?>,</span>
				<span style="font-weight:bold;font-size:16px;">Grade Level:&nbsp;&nbsp;<?=$sec->level_desc;?></span>
			<?endif;?>
		<?endif;?>
		</div>
		<div class="large-9 columns left">
			<a href="<?=site_url('teacher/my_classes');?>" style="display:inline-block;" class="confirm btn btn-warning" title="Are you sure you want to leave?">Exit</a>
			<?=form_dropdown('sections',$sections,set_value('sections',$hash),'style="width:200px;display:inline-block;" class="redirect-auto" url="'.$current_url.'"');?>
			<?=form_dropdown('student', $students,$eid_hash,'class="redirect-auto" style="width:300px;display:inline-block;" url="'.$current_url.'/'.$hash.'"');?>
		</div>
	</div>
</div>

<?if($section_exists):?>
	<?$sec = ($section_desc);?>
	<?@$this->load->view('teacher/_update_student_grades', array('sec'=>$sec))?>
<?else:?>
	<div class="panel"><p class="lead-title">Please select a section</p></div>
<?endif;?>

	<!-- grade table modal -->
	<div id="gradeTable" class="reveal-modal">
	  <a class="close-reveal-modal btn btn-danger">&#215;</a>
	  <?$this->load->view('teacher/_grading_table');?>
	</div>

<script src="<?=script_url('custom/grades');?>" type="text/javascript"></script>
<span id="load_bar" url="<?=image_url('load_bar.gif');?>"></span>
<script src="<?=script_url('custom/studentremarks');?>" type="text/javascript"></script>

<script>
	$(document).ready(function(){
		$(document).find('input[type=text]').attr('disabled','disabled');
		$(document).find('textarea').attr('disabled','disabled');

		$( "input[type=checkbox]#remarks" ).change(function() {
			if($(this).is(':checked'))
			{
				$(document).find('textarea.remarks').removeAttr('disabled');
			}else{
				$(document).find('textarea.remarks').attr('disabled','disabled');
			}
		});

		$( "input[type=checkbox]#attendance" ).change(function() {
			if($(this).is(':checked'))
			{
				$(document).find('input[type=text].attendance').removeAttr('disabled');
			}else{
				$(document).find('input[type=text].attendance').attr('disabled','disabled');
			}
		});

		$( "input[type=checkbox]#grades" ).change(function() {
			if($(this).is(':checked'))
			{
				$(document).find('input[type=text].grades').removeAttr('disabled');
				$('.pk_btn_dropdown').removeAttr('disabled');
			}else{
				$(document).find('input[type=text].grades').attr('disabled','disabled');
				$('.pk_btn_dropdown').attr('disabled','disabled');
			}
		});

    $('.pk_select').click(function(e) {
      e.preventDefault();
      var xid = $(this).attr("gp_id");
      var xvalue = $(this).attr("value");
      var xhtml = $(this).html();

      $('#pk_hidden_'+xid).val(xvalue);
      $('#btn_pk_text_'+xid).html(xhtml);

    });
	
	$('.ajax-del_subject').click(function(e) {
      e.preventDefault();
      var xvalue = $(this).attr("value");
	  var xhtml = $(this).html();

    });

	});
</script>